package com.wejoy.video.middle.station.data.enums.dict;

import com.wejoy.video.middle.station.data.exception.BusinessException;

/**
 * 数据状态枚举
 * @author admin
 */
public enum EnumGender {
    /** 审核 */
    MALE(1, "男"),

    /** The release. */
    FEMALE(2, "女"),
    ;

    private Integer code;
    private String text;

    EnumGender(Integer code, String text) {
        this.code = code;
        this.text = text;
    }

    public static EnumGender getByCode(Integer code) {
        if (null == code) {
            return null;
        }
        for (EnumGender type : EnumGender.values()) {
            if (type.getCode().equals(code)) {
                return type;
            }
        }
        throw new BusinessException("内容类型非法");
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }}
